package com.biz.primus.ms.base.service;

import com.biz.primus.ms.base.event.Executable;
import com.biz.primus.ms.base.event.RedisOptEvent;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.event.TransactionalEventListener;

/**
 *
 *
 * @author yanweijin
 * @date 2017/9/14
 */
public class DataSyncListener {

	@Autowired
	private BeanFactory beanFactory;


	@TransactionalEventListener
	public void listenRedisOptEvent(RedisOptEvent event){
		Executable opt = event.getOpt();
		if(opt!=null) opt.exec();
	}


}
